
class Function
{
public:
    double operator() (double _x);
    double derivative(double _x);
}


class EquationSolver
{
public:
    virtual double solve() = 0;
};

class Bisection
{
private:
    double a,b,delta;
    int M;
    Function func;
public:
    Bisection(double _a, double _b, double _delta, int _M, Function _f);
    double solve();
};

class Newton
{
private:
    double x0;
    int M;
    Function func;

public:
    Newton(double x0, int M, Function _f);
    double solve();
    
};
